#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)

AC_INIT([libcconf],[0.0.1],[])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([src/libcconf.c])
AC_CONFIG_HEADER([src/config.h])

# cflags
CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"

# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_LIBTOOL
LT_INIT

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([zmq.h gdsl.h pthread.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

AC_FUNC_STAT
AC_CHECK_FUNCS([strrchr memcpy strncmp])

# check for libs
AC_CHECK_LIB([zmq], [zmq_ctx_new], [], 
	[echo "Error! libcconf depends on 0MQ, libzmq." exit -1])
AC_CHECK_LIB([gdsl], [gdsl_hash], [], 
	[echo "Error! libcconf depends on GDSL, libgdsl." exit -1])
AC_CHECK_LIB([pthread], [pthread_exit])

AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
